package com.jielin.handling.service.getinformation.impl;

import com.alibaba.fastjson.JSONObject;
import com.jielin.handling.entity.getinformation.GetInfromation;
import com.jielin.handling.mapper.getinformation.GetInfromationMapper;
import com.jielin.handling.service.getinformation.GetInformationService;
import com.jielin.handling.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wangjienice on 2019-04-15.
 */
@Service
@Slf4j
public class GetInformationServiceImpl implements GetInformationService {
    @Autowired
    GetInfromationMapper getInfromationMapper;
    @Override
    public int addInformation(GetInfromation infromation) {
        log.info("infromation:{}", JSONObject.toJSONString(infromation));
        infromation.setId(StringUtil.generatorUUID());
        return getInfromationMapper.addInformation(infromation);
    }

    @Override
    public GetInfromation selectInformation(String  suspectId) {
        log.info("suspectId:{}", JSONObject.toJSONString( suspectId));
        return getInfromationMapper.selectInformation(suspectId);
    }

    @Override
    public int updateInformation(GetInfromation infromation) {
        log.info("infromation:{}", JSONObject.toJSONString( infromation));
        return getInfromationMapper.updateInformation(infromation);
    }

    @Override
    public void deleteInformationService(String suspectId) {
        getInfromationMapper.deleteInformationService(suspectId);
    }
}
